﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace _18miljard.UI.Controls
{
	public partial class PageContentControl : BaseUserControl
	{
		protected override void PreLoadHandler(object sender, EventArgs e)
		{
			this.SetMenu();
		}

		private void SetMenu()
		{
			this.MenuControl1.MenuName = "visitor";
		}

		public string MainControlClass
		{
			set
			{
				this.PlaceHolder1.Controls.Clear();

				switch (value.ToLower())
				{
					case "homecontrol.ascx":
						this.RightPadding = 150; //room for textlinks.
						break;
				}

				this.PlaceHolder1.Controls.Add(LoadControl(value));
			}
		}

		public string Text
		{
			set
			{
				Label lbl = new Label();
				lbl.Text = value;

				this.PlaceHolder1.Controls.Add(lbl);
			}
		}

		public int RightPadding
		{
			set { this.ContentDiv.Style.Add("padding-right", value.ToString() + "px;"); }
		}

	}
}